{{ flt_kibana_config | to_nice_yaml }}

{% if elk_version is version('8.13', '>=') %}
xpack.fleet.isAirGapped: {{ elk_is_air_gapped }}
{% endif %}

xpack.fleet.agents.fleet_server.hosts:
{% for host in es_master_ips %}
  - {{ elk_schema }}{{ host }}:8220
{% endfor %}

xpack.fleet.outputs:
  - id: {{ es_cluster_name }}-elasticsearch
    name: default elasticsearch output
    type: elasticsearch
    is_default: true
    is_default_monitoring: true
    config:
      ssl:
        verification_mode: "none"
        certificate: "/var/lib/elastic-agent/tls/{{ es_cluster_name }}-certificate.pem"
        key: "/var/lib/elastic-agent/tls/{{ es_cluster_name }}-certificate.key"
    hosts:
{% for host in es_master_ips %}
    - {{ elk_schema }}{{ host }}:9200
{% endfor %}

{% if elk_version is version('8.12', '>=') %}
  - id: {{ es_cluster_name }}-logstash
    name: default logstash output
    type: logstash
    is_default: true
    hosts:
{% for host in groups['logstash'] %}
    - {{ hostvars[host]['ansible_host'] }}:5044
{% endfor %}
{% endif %}
